using System.Collections.Generic;
using System.Threading.Tasks;
using JGSY.CMS.LowCode.Platform.Domain.Entities;

namespace JGSY.CMS.LowCode.Platform.Domain.Interfaces
{
    /// <summary>
    /// 发布仓储接口
    /// 提供内容发布管理的数据访问操作，支持发布、撤销、历史查询和队列管理功能
    /// </summary>
    public interface IPublishRepository
    {
        /// <summary>
        /// 发布内容
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <param name="publishTime">发布时间，可选</param>
        /// <param name="targetEnvironment">目标发布环境，可选</param>
        /// <returns>发布操作任务</returns>
        Task PublishAsync(long contentId, string? publishTime = null, string? targetEnvironment = null);
        
        /// <summary>
        /// 撤销内容发布
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <returns>撤销操作任务</returns>
        Task UnpublishAsync(long contentId);
        
        /// <summary>
        /// 分页获取发布历史记录
        /// </summary>
        /// <param name="contentId">内容标识符</param>
        /// <param name="page">页码，默认为1</param>
        /// <param name="limit">每页数量，默认为10</param>
        /// <returns>发布历史实体列表</returns>
        Task<IEnumerable<Publish>> GetPublishHistoryAsync(long contentId, int page = 1, int limit = 10);
        
        /// <summary>
        /// 分页获取发布队列
        /// </summary>
        /// <param name="status">队列状态过滤条件，可选</param>
        /// <param name="page">页码，默认为1</param>
        /// <param name="limit">每页数量，默认为10</param>
        /// <returns>发布队列实体列表</returns>
        Task<IEnumerable<Publish>> GetPublishQueueAsync(string? status = null, int page = 1, int limit = 10);
    }
}
